package com.fy.core.context;

import com.fy.sys.entity.User;

/**
 * @author hxd
 * @version 1.0
 * @ClassName AuthContext
 * @date 2023/6/16 1:56
 * @since 1.0
 */
public class AuthContext {
    private static final ThreadLocal<User> context=new ThreadLocal<>();

    public static void setUser(User user){
        context.set(user);
    }
    public static User getUser(){
        return context.get();
    }
    public static void clear(){
        context.remove();
    }
}
